import { Router } from 'express';
import { authenticate } from '../middlewares/auth';
import {
  createOrder,
  getMyOrders,
  getOrderById,
  handlePaymentCallback,
} from '../controllers/order.controller';

const router = Router();

// 所有订单路由都需要认证
router.use(authenticate);

router.post('/', createOrder);
router.get('/my', getMyOrders);
router.get('/:id', getOrderById);
router.post('/callback', handlePaymentCallback);

export default router;
